[id].vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <div>
  3. <HomePageHead></HomePageHead>
  4. <HomePageNavigation></HomePageNavigation>
  5. <HomeAdvertising :imgurl="adImg1" v-if="adImg1"></HomeAdvertising>
  6. <!-- 面包屑导航 -->
  7. <div class="breadcrumb">
  8. <div class="inner">
  9. <span class="location">当前位置:</span>
  10. <el-breadcrumb :separator-icon="ArrowRight">
  11. <el-breadcrumb-item>
  12. <NuxtLink to="/">首页</NuxtLink>
  13. </el-breadcrumb-item>
  14. <el-breadcrumb-item>
  15. <NuxtLink :to="`/${parent_pinyin}/index.html`"> {{ parent_name }}</NuxtLink>
  16. </el-breadcrumb-item>
  17. <el-breadcrumb-item>招聘详情</el-breadcrumb-item>
  18. </el-breadcrumb>
  19. </div>
  20. </div>
  21. <!-- 岗位 -->
  22. <div class="gangwei" v-if="type == 1">
  23. <main class="color_main">
  24. <main class="index_main">
  25. <section class="index_1 clearfix">
  26. <div class="cruit_head_box clearfix">
  27. <div class="cruit_head_left">
  28. <a class="cruit_head_a cruit_head_only" title="">基本信息</a>
  29. </div>
  30. </div>
  31. <div class="index_1_box clearfix">
  32. <div class="demand_head_box clearfix">
  33. <div class="demand_head_name">{{ jobInfo.title }}</div>
  34. <div class="demand_head_btn hand" v-if="type_id == 1" @click="applyJob">申请该职位</div>
  35. <div class="demand_head_btn1" v-if="type_id != 1">申请该职位</div>
  36. </div>
  37. <div class="cruit_li_2_foot clearfix">
  38. <span class="cruit_li_2_foot_tag cruit_li_2_foot_exper">
  39. {{ jobInfo.hy_name }}
  40. &gt;
  41. {{ jobInfo.zw_name }}
  42. </span>
  43. <span class="cruit_li_2_foot_tag cruit_li_2_foot_addres">{{ jobInfo.city_name }}</span>
  44. </div>
  45. </div>
  46. </section>
  47. </main>
  48. </main>
  49. <main class="index_main">
  50. <section class="index_2 clearfix">
  51. <div class="demand_1 clearfix">
  52. <div class="demand_left_1 clearfix">
  53. <div class="cruit_head_box clearfix">
  54. <div class="cruit_head_left">
  55. <a class="cruit_head_a cruit_head_only" title="">基本要求</a>
  56. </div>
  57. </div>
  58. <div class="demand_ul_2">
  59. <div class="demand_li_2 clearfix">
  60. <div class="demand_li_2_label">工作性质:</div>
  61. <div class="demand_li_2_text clearfix">{{ jobInfo.job_nature_name }}</div>
  62. </div>
  63. <div class="demand_li_2 clearfix">
  64. <div class="demand_li_2_label">工作经验:</div>
  65. <div class="demand_li_2_text clearfix">{{ jobInfo.experience_name }}</div>
  66. </div>
  67. <div class="demand_li_2 clearfix">
  68. <div class="demand_li_2_label">学历文凭:</div>
  69. <div class="demand_li_2_text clearfix">{{ jobInfo.education_name }}</div>
  70. </div>
  71. <div class="demand_li_2 clearfix">
  72. <div class="demand_li_2_label">语言选择:</div>
  73. <div class="demand_li_2_text clearfix">{{ jobInfo.language_name }}</div>
  74. </div>
  75. <div class="demand_li_2 clearfix">
  76. <div class="demand_li_2_label">薪资待遇:</div>
  77. <div class="demand_li_2_text clearfix">{{ jobInfo.salary_name }}</div>
  78. </div>
  79. <div class="demand_li_2 clearfix">
  80. <div class="demand_li_2_label">截止日期:</div>
  81. <div class="demand_li_2_text clearfix">
  82. {{ getTime(jobInfo.created_at, 'year', 1) }}
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="demand_left_2 clearfix">
  88. <div class="cruit_head_box clearfix">
  89. <div class="cruit_head_left">
  90. <a class="cruit_head_a cruit_head_only" title="">岗位职责</a>
  91. </div>
  92. </div>
  93. <article class="demand_article_1">
  94. {{ jobInfo.description }}
  95. </article>
  96. </div>
  97. <div class="demand_left_3 clearfix">
  98. <div class="cruit_head_box clearfix">
  99. <div class="cruit_head_left">
  100. <a class="cruit_head_a cruit_head_only" title="">具体要求</a>
  101. </div>
  102. </div>
  103. <article class="demand_article_1">
  104. {{ jobInfo.jt_description }}
  105. </article>
  106. </div>
  107. <div class="demand_left_4 clearfix">
  108. <div class="cruit_head_box clearfix">
  109. <div class="cruit_head_left">
  110. <a class="cruit_head_a cruit_head_only" title="">联系方式</a>
  111. </div>
  112. </div>
  113. <div class="demand_ul_2">
  114. <div class="demand_li_2 clearfix">
  115. <div class="demand_li_2_label">地址:</div>
  116. <div class="demand_li_2_text clearfix">{{ companyInfo.address_name }}</div>
  117. </div>
  118. <div class="demand_li_2 clearfix">
  119. <div class="demand_li_2_label">邮箱:</div>
  120. <div class="demand_li_2_text clearfix">{{ companyInfo.email }}</div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="demand_left_5 clearfix">
  125. <div class="cruit_head_box clearfix">
  126. <div class="cruit_head_left">
  127. <a class="cruit_head_a cruit_head_only" title="">公司介绍</a>
  128. </div>
  129. </div>
  130. <div class="demand_ul_2">
  131. <div class="demand_li_2 clearfix">
  132. <div class="demand_li_2_label">公司规模:</div>
  133. <div class="demand_li_2_text clearfix">{{ companyInfo.company_size_name }}</div>
  134. </div>
  135. <div class="demand_li_2 clearfix">
  136. <div class="demand_li_2_label">公司性质:</div>
  137. <div class="demand_li_2_text clearfix">{{ companyInfo.company_nature_name }}</div>
  138. </div>
  139. <div class="demand_li_2 clearfix">
  140. <div class="demand_li_2_label">公司行业:</div>
  141. <div class="demand_li_2_text clearfix">{{ companyInfo.hy_name }}</div>
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. <div class="demand_2 clearfix">
  147. <div class="demand_right_1 clearfix">
  148. <div class="cruit_head_box clearfix">
  149. <div class="cruit_head_left">
  150. <a class="cruit_head_a cruit_head_only" title="">招聘单位</a>
  151. </div>
  152. </div>
  153. <div class="demand_ul_1">
  154. <span class="demand_ul_1_span dot1">
  155. {{ companyInfo.business_name }}
  156. </span>
  157. </div>
  158. </div>
  159. <div class="demand_right_2 clearfix">
  160. <div class="cruit_head_box clearfix">
  161. <div class="cruit_head_left">
  162. <a class="cruit_head_a cruit_head_only" title="">其他职位</a>
  163. </div>
  164. </div>
  165. <div class="demand_ul_1">
  166. <NuxtLink class="demand_ul_1_a dot1" :href="`/${item.pinyin}/${item.id}.html`" title=""
  167. v-for="(item, index) in other_job" :key="item.id">
  168. {{ item.title }}
  169. </NuxtLink>
  170. </div>
  171. </div>
  172. </div>
  173. </section>
  174. </main>
  175. </div>
  176. <HomeAdvertising :imgurl="adImg2" v-if="adImg2"></HomeAdvertising>
  177. <HomeFoot1></HomeFoot1>
  178. </div>
  179. </template>
  180. <script setup>
  181. import { ref, reactive } from 'vue'
  182. import { ElBreadcrumb, ElBreadcrumbItem, ElMessage } from 'element-plus'
  183. import { ArrowRight } from '@element-plus/icons-vue'
  184. const route = useRoute();
  185. const type = ref(1);
  186. const nuxtApp = useNuxtApp();
  187. const axios = nuxtApp.$axios;
  188. //获取用户信息
  189. let type_id = ref('')
  190. let website_id = ref('')
  191. let getUserInfo = () => {
  192. axios.get("/user/getUserInfo").then(response => {
  193. console.log("gettypeid", response.data);
  194. type_id.value = response.data.type_id
  195. website_id.value = response.data.website_id
  196. })
  197. }
  198. onMounted(() => {
  199. getUserInfo()
  200. })
  201. //1.1 获得跳转过来的id
  202. const articleId = parseInt(route.params.id); //获得该页面的id
  203. // const existingArr = [];
  204. const articleIdArr = reactive([articleId]);
  205. // let articleIdArr = Array.of(articleId);
  206. // console.log('111222111', articleId);
  207. //1.2 获得父级栏目的名称、id
  208. //获得当前的完整路径
  209. const fullPath = route.path;
  210. //拆分,取出来中间这一段,然后提取数字部分
  211. const segments = fullPath.split('/');
  212. const targetSegment = segments[1];
  213. const targetRoute = segments[2];
  214. console.log("targetSegment1", targetSegment);
  215. console.log("targetSegment2", targetRoute);
  216. let routeId;
  217. //通过导航路径反向查询导航id
  218. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  219. method: 'GET',
  220. query: {
  221. 'pinyin': targetSegment,
  222. },
  223. });
  224. if (getRouteId.code == 200) {
  225. routeId = getRouteId.data.category_id
  226. } else {
  227. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  228. console.log("错误位置:通过url路径查询导航池id")
  229. console.log("后端错误反馈:", getRouteId.message)
  230. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  231. }
  232. //1.3 面包屑导航
  233. const parent_name = ref("");
  234. const parent_id = ref("");
  235. const parent_pinyin = ref("");
  236. let getParentNav = async () => {
  237. const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
  238. method: 'GET',
  239. query: {
  240. 'catid': routeId
  241. },
  242. });
  243. if (listData.code == 200) {
  244. parent_name.value = listData.data.alias;
  245. parent_id.value = listData.data.parent_id;
  246. parent_pinyin.value = listData.data.aLIas_pinyin;
  247. } else {
  248. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  249. console.log("错误位置:获取面包屑导航")
  250. console.log("后端错误反馈:", listData.message)
  251. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  252. }
  253. }
  254. //获得父级栏目详情
  255. getParentNav();
  256. //1.4 展示广告
  257. let adImg1 = ref({})
  258. let adImg2 = ref({})
  259. onMounted(async () => {
  260. //从客户端获取行政职能部门 加快打开速度
  261. const { $webUrl, $CwebUrl } = useNuxtApp();
  262. //广告1
  263. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0001`
  264. const responseAd1 = await fetch(url, {
  265. headers: {
  266. 'Content-Type': 'application/json',
  267. 'Userurl': $CwebUrl,
  268. 'Origin': $CwebUrl
  269. }
  270. });
  271. const resultAd1 = await responseAd1.json();
  272. adImg1.value = resultAd1.data[0];
  273. //广告2
  274. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_detail_0002`
  275. const responseAd2 = await fetch(url2, {
  276. headers: {
  277. 'Content-Type': 'application/json',
  278. 'Userurl': $CwebUrl,
  279. 'Origin': $CwebUrl
  280. }
  281. });
  282. const resultAd2 = await responseAd2.json();
  283. adImg2.value = resultAd2.data[0];
  284. })
  285. // 2 获取详情
  286. let jobInfo = ref([]) //基本信息
  287. let companyInfo = ref([])// 公司介绍
  288. let category = ref([]) // 栏目
  289. let other_job = ref([]) // 岗位
  290. let experienceInfo = ref([]) // 工作经历
  291. let education = ref([]) // 教育背景
  292. let skillList = ref([]) // 专业技能
  293. let resume = ref(0)
  294. const getDetail = async () => {
  295. const listData = await requestDataPromise('/web/getWebsiteJobInfo', {
  296. method: 'GET',
  297. query: {
  298. 'id': articleId,
  299. 'type': type.value,
  300. 'pageSize': 10,
  301. },
  302. });
  303. if (listData.code == 200) {
  304. console.log("详情1111", listData.data);
  305. // console.log("详情1111222", listData.data.job[0].job_experience);
  306. // console.log("详情111122233", JSON.parse(listData.data.job[0].job_experience));
  307. // console.log("详情1111222233344", JSON.parse(listData.data.job[0].education_experience));
  308. // jobInfo.value = listData.data.job[0];
  309. // category.value = listData.data.category;
  310. if (type.value == 1) {
  311. jobInfo.value = listData.data.job[0];
  312. category.value = listData.data.category;
  313. companyInfo.value = listData.data.company[0];
  314. other_job.value = listData.data.other_job;
  315. }
  316. if (type.value == 2) {
  317. jobInfo.value = listData.data.job[0];
  318. category.value = listData.data.category;
  319. experienceInfo.value = listData.data.job_experience;
  320. education.value = listData.data.education_experience;
  321. skillList.value = JSON.parse(listData.data.job[0].skillList);
  322. resume.value = listData.data.resume;
  323. }
  324. }
  325. }
  326. getDetail();
  327. //获取行业 职位 具体职位
  328. const industry_categoryList = ref([]) //行业类别列表
  329. const position_categoryList = ref([]) //职位类别列表
  330. const positionList = ref([]) //具体职位列表
  331. const getData = async () => {
  332. const getData = await requestDataPromise('/web/getWebsiteJobSelect', {
  333. method: 'GET',
  334. query: {},
  335. });
  336. if (getData.code == 200) {
  337. // console.log("获取到的分类数据:", getData.data);
  338. industry_categoryList.value = getData.data.hy; //行业
  339. position_categoryList.value = getData.data.zw; //职位
  340. positionList.value = getData.data.jtzw; //具体职位
  341. }
  342. }
  343. getData()
  344. // 3 申请该职位
  345. const applyJob = () => {
  346. // console.log("点击了申请该职位", typeof website_id.value);
  347. // console.log("点击了申请该职位", articleIdArr);
  348. axios.post('/web/getWebsiteJobApply', {
  349. website_id: website_id.value,
  350. recruit_id: articleIdArr,
  351. }).then(response => {
  352. // console.log("申请该职位11111111", response);
  353. if (response.code == 200) {
  354. ElMessage({
  355. message: '申请成功',
  356. type: 'success',
  357. });
  358. } else {
  359. ElMessage({
  360. message: response.message,
  361. type: 'error',
  362. });
  363. }
  364. }).catch(error => {
  365. console.error('Error:', error);
  366. });
  367. }
  368. //4.设置seo信息 start---------------------------------------->
  369. //4.1 设置seo信息
  370. let seoTitle;
  371. let seoDescription;
  372. let seoKeywords;
  373. const listData = await requestDataPromise('/web/getWebsiteJobInfo', {
  374. method: 'GET',
  375. query: {
  376. 'id': articleId,
  377. 'type': type.value,
  378. 'pageSize': 10,
  379. },
  380. });
  381. if (listData.code == 200) {
  382. // console.log("详情1111", listData.data);
  383. seoTitle = listData.data.job[0].title;
  384. seoDescription = listData.data.job[0].seo_description;
  385. seoKeywords = listData.data.job[0].keyword;
  386. }
  387. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  388. method: 'GET',
  389. query: {
  390. 'catid': routeId,
  391. },
  392. });
  393. if (setData.code == 200) {
  394. let seoSuffix = setData.data.suffix;
  395. let seoName = setData.data.website_name;
  396. useSeoMeta({
  397. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  398. meta: [
  399. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  400. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  401. { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
  402. ]
  403. });
  404. } else {
  405. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  406. console.log("错误位置:设置列表页面SEO数据")
  407. console.log("后端错误反馈:", setData.message)
  408. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  409. }
  410. //4.设置seo信息 end---------------------------------------->
  411. </script>
  412. <style scoped lang="less">
  413. @import "@/assets/css/zgzpjianli.less";
  414. @import "@/assets/css/zgzpzhaopin.less";
  415. </style>